package com.csu.server.module.msgProcessControl;

import com.csu.message.BaseMessage;
import com.csu.server.module.msgProcess.IMessageProcess;


public class ServerReceivedMessageProcess {

	private static ServerReceivedMessageProcess instance;
	
	
	public static ServerReceivedMessageProcess getInstance() {
		if(instance==null){
			instance=new ServerReceivedMessageProcess();
		}
		return instance;
	}

	private ServerReceivedMessageProcess(){
		
	}

	public void processMessage(BaseMessage message){
		int messageType=message.getMsgType();
		MessageProcessFactory factory=MessageProcessFactory.getInstance();
		IMessageProcess process=factory.creatMessageProcess(messageType);
		process.processMessage(message);
	}
	
}
